home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3345 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: quick decision: is n a power of 2?
  5. Date: Sun, 28 Jan 96 01:11:22 GMT
  6. Organization: none
  7. Message-ID: <822791482snz@genesis.demon.co.uk>
  8. References: <Pine.OSF.3.91.960119114608.18779E-100000@io.UWinnipeg.ca> <4e1aeb$1gl8@cymbal.aix.calpoly.edu> <822516891snz@genesis.demon.co.uk> <4e8asi$ehg@ns.RezoNet.NET> <4ee32r$18e1@cymbal.aix.calpoly.edu>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4ee32r$18e1@cymbal.aix.calpoly.edu>
  15.            dstubbs@cymbal.aix.calpoly.edu "Dan Stubbs" writes:
  16.  
  17. >When that data was posted it was pointed out that it was normalzed. For
  18. >example, the times needed by four techniques (two of them shown above) to
  19. >check the first 5,000,000 integers to see which of them is a power of 2
  20. >was  185  1,333  167  341. The difference between 167 and 185 comes from
  21. >the difference in how the compiler (set to its highest optimization level)
  22. >treated the two expressions noted above. Unfortunately, I think there is
  23. >a real difference. 
  24.  
  25. The only way to be sure is to compare the object code generated for the
  26. 2 cases.
  27.  
  28. -- 
  29. -----------------------------------------
  30. Lawrence Kirby | fred@genesis.demon.co.uk
  31. Wilts, England | 70734.126@compuserve.com
  32. -----------------------------------------
  33.